<?php

/*
 * @author Ebrain Cedeno <ebraincedeno@gmail.com>
 */
class Templete{
    
    public static $theme_name = "Default";
    private $theme;
    public static $headerTheme;
    public static $footerTheme;
    
    public function loadThemeContent(){
        
        $this->theme = file_get_contents(VeCms::getPathTemplete()."/".self::$theme_name.".php");
        
        if ($this->theme){
            
            if (stripos($this->theme,"{javascript}") !== FALSE){
                $this->theme = str_replace("{javascript}", VeCms::loadJsBase(), $this->theme);
            }
            
            
            if (stripos($this->theme,"{pathimage}") !== FALSE){
                $this->theme = str_replace("{pathimage}", VeCms::getPathImage(), $this->theme);
            }
           
            
            if (stripos($this->theme,"{content}") !== FALSE){
                $this->theme = explode("{content}",  $this->theme);
                self::$headerTheme = $this->theme[0];
                self::$footerTheme = $this->theme[1];
                
            }
            else{
                throw new Exception("No se encontro la etiqueta content en el templete");
            }
        }
    }
   
    
    
    
}
?>
